package com.kla.power.mapper;

import com.kla.power.entity.RoleEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author WuZH
 * @since 2024-06-02
 */
@Mapper
public interface RoleMapper extends BaseMapper<RoleEntity> {


    @Select (value = "SELECT * FROM role_info ri where isUsed=1 limit #{roleEntity.page}, #{roleEntity.limit}")
    List<RoleEntity> queryList (@Param ("roleEntity") RoleEntity roleEntity);

    @Select (value = "SELECT COUNT(1) FROM role_info ri where isUsed=1")
    Integer queryCount (@Param ("roleEntity") RoleEntity roleEntity);

}
